<!DOCTYPE HTML>
<html>
<head>
    @include('common.header')
    <title>站点信息</title>
</head>
<body>
<div class="page-container">
    <form action="" method="post" class="form form-horizontal" id="form-user-add">
        {{--<input type="hidden" name="id" value="{{$info['id']}}">--}}
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">单位名称：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="text" class="input-text" value="{{$info['company_name'] or null}}" placeholder="" id="" name="company_name">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">单位地址：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="text" class="input-text" value="{{$info['company_addr'] or null}}" placeholder="" id="" name="company_addr">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">电话号码：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="text" class="input-text" value="{{$info['tel'] or null}}" placeholder="" id="" name="tel">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">手机：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="text" class="input-text" value="{{$info['phone'] or null}}" placeholder="" id="" name="phone">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">传真：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="text" class="input-text" value="{{$info['fax'] or null}}" placeholder="" id="" name="fax">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">邮箱：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="text" class="input-text" value="{{$info['email'] or null}}" placeholder="" id="" name="email">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">联系人：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="text" class="input-text" value="{{$info['contact'] or null}}" placeholder="" id="" name="contact">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">QQ：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="text" class="input-text" value="{{$info['qq'] or null}}" placeholder="" id="" name="qq">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">微信：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="text" class="input-text" value="{{$info['wechat'] or null}}" placeholder="" id="" name="wechat">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">邮编：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="text" class="input-text" value="{{$info['zipcode'] or null}}" placeholder="" id="" name="zipcode">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">备案号：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="text" class="input-text" value="{{$info['record_number'] or null}}" placeholder="" id="" name="record_number">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">域名：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="text" class="input-text" value="{{$info['site_url'] or null}}" placeholder="" id="" name="site_url">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">公司详情：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <!-- 加载编辑器的容器 -->
                <textarea id="container" name="detail" type="text/plain">{{$info['detail'] or null}}</textarea>
            </div>
        </div>
        <div class="row cl">
            <div class="col-9 col-offset-2">
                <input class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;保存&nbsp;&nbsp;" onclick="return false;">
            </div>
        </div>
    </form>
</div>
@include('common.footer')

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="{{asset('hui-admin/lib/jquery.validation/1.14.0/jquery.validate.js')}}"></script>
<script type="text/javascript" src="{{asset('hui-admin/lib/jquery.validation/1.14.0/validate-methods.js')}}"></script>
<script type="text/javascript" src="{{asset('hui-admin/lib/jquery.validation/1.14.0/messages_zh.js')}}"></script>
<script type="text/javascript" src="{{asset('hui-admin/lib/ueditor/1.4.3/ueditor.config.js')}}"></script>
<script type="text/javascript" src="{{asset('hui-admin/lib/ueditor/1.4.3/ueditor.all.min.js')}}"> </script>
<script type="text/javascript" src="{{asset('hui-admin/lib/ueditor/1.4.3/lang/zh-cn/zh-cn.js')}}"></script>
<script type="text/javascript">
    var ue = UE.getEditor('container',{
        initialFrameHeight: 200,
        initialFrameWidth: 815
    });

    $('input[type=submit]').click(function () {
        _company_name = $('input[name=company_name]').val();
        _company_addr = $('input[name=company_addr]').val();
        _tel = $('input[name=tel]').val();
        _phone = $('input[name=phone]').val();
        _fax = $('input[name=fax]').val();
        _email = $('input[name=email]').val();
        _contact = $('input[name=contact]').val();
        _qq = $('input[name=qq]').val();
        _wechat = $('input[name=wechat]').val();
        _zipcode = $('input[name=zipcode]').val();
        _record_number = $('input[name=record_number]').val();
        _site_url = $('input[name=site_url]').val();
        _detail = $('textarea[name=detail]').val();

        _json_data = {
            'company_name':_company_name,
            'company_addr':_company_addr,
            'tel':_tel,
            'phone':_phone,
            'fax':_fax,
            'email':_email,
            'contact':_contact,
            'qq':_qq,
            'wechat':_wechat,
            'zipcode':_zipcode,
            'record_number':_record_number,
            'site_url':_site_url,
            'detail':_detail
        };
        $.ajax({
            type:'post',
            url:'/System/SiteInfo.html',
            data:_json_data,
            dataType:'json',
            success:function(data){
                if(data.code == 1) {
                    layer.msg('保存成功',{icon:1,time:1000});
                }else{
                    layer.msg(data.msg);
                }
            }
        });
        return false;
    });
</script>
</body>
</html>